public class zombie {

    String name;
    int hp;
    int attack;


    public zombie(String name, int hp, int attack){
        this.name = name;
        this.hp = hp;
        this.attack = attack;
    }

    public void attacks(plant zw){
        System.out.println(this.name+"攻击植物");
        zw.hp -= this.attack;
        System.out.println("植物的血量为："+zw.hp);
    }
}
